﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows;

namespace TMI85303.UI.Cov
{
    public class BoolToVisibilityCov : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // 如果传入的值为true，则返回Visible，否则返回Collapsed
            return (bool)value ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // 如果需要从Visibility转换回布尔值，你可以在这里实现
            throw new NotImplementedException();
        }
    }
}
